<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script src="../../widget/d3.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var width = 300;
	var height = 300;
	
	var svg = d3.select("body")
					.append("svg")
					.attr("width",width)
					.attr("height",height);
					
	//绘制矩形
	var dataset=[250,220,270,240,90];
	svg.selectAll("rect")
			.data(dataset)
			.enter()
			.append('rect')
			.attr('x',20)
			.attr('y',function(d,i){
				return i* 25
			})
			.attr('width',function(d){
				return d;
			})
			.attr('height',25 - 2)
			.attr('fill','steelblue')
</script>